export const getCurrentCity = () => {
  const localCity = localStorage.getItem("hkzf_city");
  if (!localCity) {
    return new Promise((resolve, reject) => {
      var myCity = new window.BMapGL.LocalCity();
      try {
        myCity.get((res) => {
          localStorage.setItem("hkzf_city", res.name);
          resolve(res.name);
        });
      } catch (error) {
        reject();
      }
    });
  }
  return Promise.resolve(localCity);
};
